The space field in the transfer mode structure specifies the color space the transfer mode calculations take place in. This space does not need to be the same as the color space specified by the ink's color, or the destination color space as specified by the view port or view device with which the ink is associated. The source and destination colors are converted into the color space that provides the context for the transfer, and the resulting color is then reconverted to the destination color space. Keep in mind that all transfer mode computations take place in the transfer mode's color space.
You needn't convert color values among different spaces yourself in order to use a different transfer mode. The transfer mode operation automatically converts colors from the ink's color space and the view device's color space, manipulates them, and then converts the result color back to the view device's color space for drawing. In creating shapes, you can work in whatever color space is convenient for you; when drawing, you can use any transfer mode color space you want; and neither color space need be the same as the color space used by the view device to which you are drawing.
Figure 47 , for example, shows a source color in RGB space as specified in an ink object, a destination color in RGB space as specified by a monitor, and a transfer mode color space of HSV, as specified by the application. The component modes selected mean that the hue and saturation of the destination are preserved, but the value (lightness) of the source is maintained. QuickDraw GX automatically performs all necessary conversions.
Figure 47 Automatic conversion of color values during a transfer mode operation
The transfer mode color space defines how many components are required to perform the transfer mode operation. Monochromatic (grayscale) color spaces require only one component to be filled out. Alpha-channel spaces and CMYK space require four components to be filled out. All other spaces require three components to be filled out.
Note
Choosing a different color space can radically affect the behavior of a transfer mode. For example, if your transfer mode uses RGB space, and you have specified
gxCopyMode
for the component mode of
component[0]
and
gxNoMode
for the other components in the transfer mode structure, drawing will transfer only the red component of your source image to the destination and leave the blue and green components of the destination as they are. If you then change the transfer mode color space to HSV and redraw, all hues in your source image will be transferred to the destination, but with the brightnesses and saturations of the original destination image.
| Previous | Chapter Contents | Chapter Top | Next |